package com.nf.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117603634";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCtMtb7u6VueVvHBRZOWquAbzW0OM2g8IvG3kA3qtFMgZb9rsVCyBwJtk6hmAOXiQR+kTYhqUKcltm/TgJ8JvGfekH07Od5n0VfDLiUBprN8sZOfxATkMawjEyEysYHEghORm2MMHTv0F86Bg2rxu5WlzW76Lg/pte3NEarEpoSNDuudcHuxew7qr4sh/P9biOYLe9y9RDbA0N/ThX2y+8GNbt2NVxiDyYe/q4ZUANtZj6ASYqovs31sdG6TaY4v7DqikOZuWE0zQtknZF6FKSn9zA29Mt0uXyI5TmxOEfjF2y18Jyh0jKto0sFvY6LbcKEUuLwyRIX7XDlYpLLR0W9AgMBAAECggEAFpXElvr3LZrBrwgoynrkVlEqLaAioFP9xicBNMEfndxgNiBuNLEnhtSxGD1caoxBe8evyV/rAcRiDKI9jLb/Vw54P1oNLTzprOVZxGPAGA8KcP38uLBuWGNTLxXKEO33C03/xwIinYsMf+J+MeI0/jGlniVQsWwuQQOeG3zHfov9nee0ezt/pO3v/G7yK7pBKoZLxlGJKZTWsKKPCjTbpChrUuHaWmdO01D1thSYWgd3Y4YW8HrR+R3dpDrpxUL439K1qRlYGHZYZ28wQAMu1lqlOyjU7WkYsSC/IQrIN8vb3l5Sbjwxb7vtAQsUmtwnPOGABYCs1TMB8y6mfpnIeQKBgQD0VIHotx63wjGzbXySaip5KBIGU8ofHKbAMo8s95TRfKDeloso3qHLAZsRidHmF0ifD3nXZNvYJAKCJ0SYFjZbGPYe4XzCNLaG+xNwnDwS2zc7Gez/h374pL8E43MjoMcVfbRajJazVSuMu5dplP/t5cr2u8DuHrmin1D4DAm2owKBgQC1eJZgK0CNEfWCf1TBDaZfWJSAragsivUofYkt/dckdOkNqYenywfzFyovnGybjOE/+QE7mxB6pND1SRanrobBRnpG/poqmVPHwkeyS3C323GL2wGu3M/uKq5vs+QjSHt8mO0XeC/TGnqY0PJFna2Sr6S2fy5LOA3Jp6Va2Ce4HwKBgHEZoV0ZT1XexeT5/J1GGc0luFpHdRu7xpDXlqFJJhFm8Iy5AUf07s4rOx3+PzSUeKBwqIUFgiLmYGbhSIZiWd0Hi/61gGvhvNB07wXEvKY55bItCSEsFqGAmY/ovcazSRTwsIjt5WC0P0mRGMDeIS59ndtjBCb2ABaASxnXcLOjAoGARMjNbuxWDmK1RV6QOJC89Dz2JQQtz5xoKo3S1mz2BGqP/863jaFGhRzNr7hB7n/qzT3L+tTe3S3lymOGw85CY7YcGRbeRrFRcVExreIsenQiSNmdfLNT2TmyXsK4AauyqtqoW5IBxqmtuIjSnBKVPRl4fHgeiwJXL41s/s8Z1w8CgYEAjfD0JMlrBBHQ6dF+lL6slFIMcMpjT3IozZE8qN7Qmjezr6lHYXDdeujf191Byxb/Z4s49xbwB/ojb2NaYfr6QQCa0G1E6H2xck5wf6r1rVFNs0ou1mAYnQEbqH6rmHbA2QFl1YKh8ng/jcoqiv3/XMnybfcEHHSEJPLFoBOWs7k=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxcj0ABEzvHXugjzpn6rPILBAKtAsWxygu03kUh/6gnG9C1ja4ebpKWzwulCSn82Q/fJ9B3fjAMkwYf0pgKNG2oW3g7VAU2O6Ekcaq+A4Zeav0foNUtUpOn3PbxQKiIkZJwEgmgFYcysafHjjFY/Eu+aBt+w/cuO8lUkKO+IXmbITV3PTs3CGCSieWzIt+kj7zC5Fj6WJ0Y0nbdxQNcTIvVzr1nYSFUiIUyweUSLkGMG6C380qp8ykLxfG3xwtKKI2PwNui3HrIF6fchuy2JncTRb/g3etj9FTrM2k7MYOgmoaYIBfAnLoGhGvqDn/cqsYbSYsQtvycfB9wBFVCQmCwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/cinema/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://127.0.0.1:5500/home/success.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

